package com.example.pojo;

public class User {
    // 定义属性，根据数据库表的字段，给这些属性增加公开的set/get方法
    private Integer id;
    private String name;
    private String password;

    public User() {
        System.out.println("mybatis调用了空参构造方法吗");
    }

    public User(Integer id, String name, String password) {
        System.out.println("mybatis调用了带参构造方法吗");
        this.id = id;
        this.name = name;
        this.password = password;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        System.out.println("这里的方法会执行吗");
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    // 所有类的父类Object
    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
